GT.tip = {}

---生成属性文本
---@param data table<uKeyAttr, number>
function GT.tip.attr(data)
    if data==nil then
        return ''
    end
    local sb = StringBuilder.new()
    for k, v in pairs(data) do
        if string.find(k, '-')~=nil then
            local key=string.gsub(k, "-", "")
            if data ~= nil then
                if string.findi(key, '%%') ~= nil then
                    sb:append_line("#FF0000" .. key .. "-" .. v .. "%" .. "#FFFFFF")
                else
                    sb:append_line("#FF0000" .. key .. "-" .. v .. "#FFFFFF")
                end
            end
        end

        if string.find(k, '+')~=nil then
            local key=string.gsub(k, "+", "")
            if data ~= nil then
                if string.findi(key, '%%') ~= nil then
                    sb:append_line("#33FF00" .. key .. "+" .. v .. "%" .. "#FFFFFF")
                else
                    sb:append_line("#33FF00" .. key .. "+" .. v .. "#FFFFFF")
                end
            end
        end

        if string.find(k, '+')==nil and string.find(k, '-')==nil then
            local key=string.gsub(k, "=", "")
            if data ~= nil then
                if string.findi(key, '%%') ~= nil then
                    sb:append_line("#33FF00" .. key .. "=" .. v .. "%" .. "#FFFFFF")
                else
                    sb:append_line("#33FF00" .. key .. "=" .. v .. "#FFFFFF")
                end
            end
        end

    end
    return sb:tostring(true)
end
